#!/usr/bin/env python
# -*- coding: utf-8 -*-
#code:utf-8
#
# Copyright(C) 2011 SupDo.com
# Licensed under the GUN License, Version 3.0 (the "License");
# 
# File:        pages.py
# Author:      KuKei
# Create Date: 2012-03-13
# Description: 异常页面处理视图
# Modify Date: 2012-03-13

from sd.cms.views import BaseView

class ErrorPage(BaseView):   
    def main(self, type):
        if(type=='404'):
            self.render('/snippet/404.html')
        elif(type=='500'):
            self.render('/snippet/500.html')
        return self.rtor
    
def view404(request):
    return ErrorPage(request).main('404')

def view500(request):
    return ErrorPage(request).main('500')